Skip to content

Conversation

devnexen
Copy link
Member

@devnexen devnexen commented Oct 5, 2024

No description provided.

@devnexen devnexen linked an issue Oct 5, 2024 that may be closed by this pull request
@@ -44,6 +44,9 @@ getmbi (int (*getin) (void *in), void *in)
i = getin (in);
if (i < 0)
return (-1);
long long chk = (long long)(mbi) << 7;
if (chk > INT_MAX || (chk | (long long)(i & 0x7f)) > INT_MAX)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How can the second condition ever be true? i & 0x7f is at most 0x7f, ORing t hat with chk will not allow you to reach the limit.
Note that this bug was already fixed upstream by libgd/libgd@a8f1d5c

@devnexen devnexen closed this in 54973c9 Oct 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

UBSan alert in ext/gd/libgd/wbmp.c:47
2 participants